import pygame
import spyral
import time;

import Dic


class GameInstruction(spyral.sprite.Sprite):
    def __init__(self, num):
        spyral.sprite.Sprite.__init__(self)
        if (num == 1):
            self.image = pygame.image.load(Dic.images['001instr'])
        elif (num == 2):
            self.image = pygame.image.load(Dic.images['002instr'])
        elif (num == 3):
            self.image = pygame.image.load(Dic.images['003instr'])
        elif (num == 4):
            self.image = pygame.image.load(Dic.images['004instr'])
        elif (num == 5):
            self.image = pygame.image.load(Dic.images['005instr'])
        elif (num == 6):
            self.image = pygame.image.load(Dic.images['006instr'])
        elif (num == 7):
            self.image = pygame.image.load(Dic.images['007instr'])
        
        self.rect.center = (480, 320);
        self.layer = 2;
        self.alpha = 0;
        self.image.set_alpha(self.alpha)
        self.instruction = 1;
        self.up = True;

        
    def update(self, tick):
        if (self.up):
            self.alpha += 25
            if (self.alpha >= 255):
                self.up = False;
        elif (self.alpha > 0):
            self.alpha -= 7;
        else:
            self.kill();
        self.image.set_alpha(self.alpha)
        self.image = self.image.copy()
            